<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>群聊天记录列表</title>
    <?php require 'templates/common/head.html'; ?>
    <style type="text/css">
        .divleft{width: 25%; float: left; text-align:left; border-right: solid 1px #d5d5d5; margin-right: 2% }
        .divcenter{width: 25%; float: left; text-align:left; border-right: solid 1px #d5d5d5; margin-right: 2%}

        .divright{ width: 15%; float: left; text-align:left;  margin-right: 2%}
        .position {
            position: absolute;
            display: none;
            z-index: 15;
            width: 400px;
            height: 40px;
            margin: -20px 0 0 -75px;
            padding: 0 10px;
            background: #eee;
            line-height: 2.4;
            cursor:pointer;
        }
    </style>
</head>
<body>


<div class="container-fluid">
    <?php require 'templates/common/nav.html'; ?>
    <div class="panel panel-primary">
        <div class="panel-heading text-center"><h3 class="panel-title">群聊天记录列表</h3></div>
        <div class="panel-body" style="text-align:center">
            <div style="margin: 0 0 10px 0;text-align:left"><b style="color:#3c763d;font-size: 16px;">聊天记录查询</b><br/>
                <form action="" method="get">
                    <input type="hidden" name="m" value="group_manage"/>
                    <input type="hidden" name="a" value="view_chat_logs"/>
                    <input type="hidden" name="id" value="<?=$_GET['id']?>"/>
                    姓名：<input type="text" name="name" value="<?=$name?>">&nbsp;&nbsp;
                    聊天记录：<input type="text" name="content" value="<?=$content?>">&nbsp;&nbsp;
                    <button type="submit"  class="btn btn-default btn-success ">&nbsp;查 询&nbsp;</button>

                </form>
            </div>
            <div style="margin: 0 50px 10px 0;text-align:right;">
                <form action="index.php?m=group_manage&a=export_chat" method="post">
                    <input type="hidden" name="groupId" value="<?=$_GET['id']?>"/>
                    <button type="submit"  class="btn btn-default btn-success ">&nbsp;导 出&nbsp;</button>
                </form>
            </div>



            <div class="panel-group"  id="accordion" role="tablist" aria-multiselectable="true">
                <div class="panel panel-default">
                    <div class="panel-heading" style="background-color:#d5d5d5">
                    <div class="row" >
                            <div class="divleft">成员名称</div>
                            <div class="divcenter">内容</div>
                            <div class="divcenter">聊天类型</div>
                            <div class="divright" style="text-align:center">操作</div>
                        </div>
                    </div>
                </div>
                <?php foreach($chats as $v):?>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <div class="row" >
                                <div class="divleft"><?=$v['name']?>&nbsp;</div>
                                <div class="divcenter">
                                    <?php if($v['聊天类型']=='语音'):?>
                                        <audio controls="controls">
                                            <?php if (!$v['地址']) :?>
                                            <?php $v['地址'] = 'http://' . $_SERVER['HTTP_HOST'] . '/Ram_disk/'. $v['serverid'] .'.mp3';?>
                                            <?php endif;?>
                                            <source src="<?=$v['地址']?>" type="audio/mpeg" />
                                            Your browser does not support the audio element.
                                        </audio>
                                    <?php elseif($v['聊天类型']=='文本'):?>
                                        <?=$v['聊天内容']?>　　　&nbsp;
                                    <?php elseif($v['聊天类型']=='图片'):?>
                                        <?php if (!$v['地址']) :?>
                                        <?php $v['地址'] = 'http://' . $_SERVER['HTTP_HOST'] . '/Ram_disk/img/'. $v['serverid']. '.jpg';?>
                                    <?php endif;?>
                                        <a href="<?=$v['地址']?>" target="_blank"><img src="<?=$v['地址']?>"  width="200" height="200"></a>
                                    <?php endif;?>
                                </div>
                                <div class="divcenter">
                                    <?=$v['聊天类型']?>
                                </div>
                                <div class="divright" style="text-align:center">
                                    <a href="index.php?m=group_manage&a=del_chat&chatId=<?=$v['id']?>&groupId=<?=$v['群id']?>&page=<?=$_GET['page']?>" onclick=" javascript:  return  confirm('是否确认删除?')">删除</a>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php endforeach;if(!$chats):?>
                    <div class="panel-heading text-center"><h3 class="panel-title">没有数据 !!!</h3></div>
                <?php endif;?>
            </div>
           <div><?=$page->showpage()?></div>
        </div>

    </div>
</div>
<?php require 'templates/common/foot.html'; ?>
</body>
</html>